# Third-party / historical research

MarsCam Modern contains newly written code and does not redistribute the proprietary 2002 Windows MR97310 driver binaries.

Protocol behavior is informed by libgphoto2's long-lived Mars MR97310 backend, particularly `camlibs/mars/mars.c`, `library.c`, and `protocol.txt`. libgphoto2 code is licensed under the GNU Lesser General Public License; MarsCam Modern's implementation should remain independently written while using documented/observed protocol behavior as research material.

Important behaviors cross-checked against libgphoto2 include:

- USB OUT endpoint `0x04` for Mars commands/status requests.
- USB IN endpoint `0x83` for 16-byte command/status responses.
- USB IN endpoint `0x82` for configuration and image data.
- `0x02` startup "jammed" handling through a single-byte `0x19` exchange.
- GET_DATA operation `0x0f` and per-item address bytes from PAT fields 1 through 6.
- PAT stored-size calculation from bytes 4 through 6.
- Padded image-transfer size formula.
- The 128-byte lead-in discarded before interpreting a downloaded photo.
- Config layouts with 16 or 144 bytes preceding the PAT.

Project code: MIT. Upstream/historical code retains its original license.

## libgphoto2 Mars image-processing behavior

MarsCam Modern 0.6.1 contains an independent C++ behavioral port of the published Mars MR97310 gamma/white-balance/color-enhance algorithm from libgphoto2 (`camlibs/mars/library.c`, `camlibs/mars/mars.c`) and its gamma-table behavior (`libgphoto2/gamma.c`). libgphoto2 is LGPL-2.1-or-later. This project does not claim that the proprietary Windows MarsCam application used the same image-processing pipeline.


## Mars compressed-image decoder research (0.6.1)

The historical reference implementation in libgphoto2 `camlibs/mars/mars.c` contains a `mars_decompress` routine using a small variable-length Huffman-like codebook plus Bayer-aware spatial prediction. MarsCam Modern 0.6.1 includes an independently written C++ behavioral implementation for interoperability/research and explicitly attributes that published behavior here. libgphoto2 is LGPL-2.1-or-later.
